package main

import "fmt"

//定义价格的函数
func printPrice(weather string) {
	defaultPrice := 10
	if weather == "sunny" {
		defaultPrice = 10
		fmt.Println("It's sunny")
		fmt.Println("The price is", defaultPrice)
	} else {
		defaultPrice = 100
		fmt.Println("It's not sunny")
		fmt.Println("The price is", defaultPrice)

	}
}
func main() {
	//if else
	//if 表达式 {代码块} else{代码块}
	//if 表达式 {代码块} else if 表达式 {代码块} else{代码块}
	weather := "sunny"
	printPrice(weather)
	weather = "rainy"
	printPrice(weather)
}
